fix: AuthData validation incorrectly triggered on unchanged providers#10025
fix: AuthData validation incorrectly triggered on unchanged providers#10025
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the
📝 WalkthroughWalkthroughFixes authData validation logic to validate only providers with actual changes (id differences or unlinking) rather than all existing providers. Modifies mutation detection from deep equality checks to id-level comparison. Adds test cases validating multi-provider authentication flows where one provider is added while another remains unchanged. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚀 Thanks for opening this pull request! |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## alpha #10025 +/- ##
==========================================
- Coverage 92.55% 92.54% -0.01%
==========================================
Files 190 190
Lines 15490 15499 +9
Branches 176 176
==========================================
+ Hits 14336 14343 +7
- Misses 1142 1144 +2
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai is this a breaking change? |
|
Tip For best results, initiate chat on the files or code changes.
Here's why:
Behavioral change clarification: While this is a behavioral change in how mutation detection works, it's not "breaking" in the conventional sense because:
The only theoretical edge case would be if someone had a custom auth adapter that relied on re-validation when non- |
## [9.2.1-alpha.2](9.2.1-alpha.1...9.2.1-alpha.2) (2026-02-06) ### Bug Fixes * AuthData validation incorrectly triggered on unchanged providers ([#10025](#10025)) ([d3d6e9e](d3d6e9e))
|
🎉 This change has been released in version 9.2.1-alpha.2 |
# [9.3.0](9.2.0...9.3.0) (2026-02-21) ### Bug Fixes * `Parse.Query.select('authData')` for `_User` class doesn't return auth data ([#10055](#10055)) ([44a5bb1](44a5bb1)) * AuthData validation incorrectly triggered on unchanged providers ([#10025](#10025)) ([d3d6e9e](d3d6e9e)) * Default ACL overwrites custom ACL on `Parse.Object` update ([#10061](#10061)) ([4ef89d9](4ef89d9)) * Default HTML pages for password reset, email verification not found ([#10034](#10034)) ([e299107](e299107)) * Default HTML pages for password reset, email verification not found ([#10041](#10041)) ([a4265bb](a4265bb)) * Incorrect dependency chain of `Parse` uses browser build instead of Node build ([#10067](#10067)) ([1a2521d](1a2521d)) * Unlinking auth provider triggers auth data validation ([#10045](#10045)) ([b6b6327](b6b6327)) ### Features * Add `Parse.File.url` validation with config `fileUpload.allowedFileUrlDomains` against SSRF attacks ([#10044](#10044)) ([4c9c948](4c9c948)) * Add event information to `verifyUserEmails`, `preventLoginWithUnverifiedEmail` to identify invoking signup / login action and auth provider ([#9963](#9963)) ([ed98c15](ed98c15)) * Add support for streaming file upload via `Buffer`, `Readable`, `ReadableStream` ([#10065](#10065)) ([f0feb48](f0feb48)) * Upgrade to parse 8.2.0, @parse/push-adapter 8.3.0 ([#10066](#10066)) ([8b5a14e](8b5a14e))
|
🎉 This change has been released in version 9.3.0 |
Pull Request
Issue
Multi-provider authData updates fail when code-based adapters strip sensitive fields via
afterFind(). Parse Server re-validates unchanged providers, but the stripped fields (e.g.,code) cause validation to fail.Root cause:
hasMutatedAuthData()usedisDeepStrictEqual()for change detection. WhenafterFind()strips fields, the deep comparison treats unchanged providers as mutated.Approach
The fix changes hasMutatedAuthData in Auth.js to use subset comparison.
Summary by CodeRabbit
Tests
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.